/**
 * @class MyNamespace.Login
 * @extends extendsClass
 * Description
 */
Ext.define('MyApp.controller.Login', {
    extend: 'Ext.app.Controller',
    requires: [
        'MyApp.util.Helper'
    ],

    config: {
        refs: {
        	loginView: 'login'
        },

        control: {
        	loginView: {
        		taplogin: 'onTapLogin',
        		initialize: 'onLoginInit',
        		destroy: 'onLoginDestroy'
        	}/*
        	,'login button#btnLogin': {
        		tap: 'onBtnLoginTap'
        	}*/
        }
    },

    onLoginInit: function () {
    	
    },
    /*onBtnLoginTap: function(){
    	var loginView = this.getLoginView();


    	console.log('点击了登录')
    },*/

    onTapLogin: function(view, btn, e){
    	var vals = view.getValues();
    	//debugger
    	MyApp.util.Helper.invoke('login.json', vals, {
    		success: function(result){
    			//console.log(result);
    			var main = Ext.widget('main');
    			Ext.Viewport.add(main);
    			Ext.Viewport.setActiveItem(main)
    		}
    	});
    }
});